package com.zhuang.chapter09.work04;

import java.util.Scanner;

public class DivisibleOperation {

	public static void main(String[] args) {
		System.out.println("输入整型除数和被除数,形如a/b");
		Scanner sc = new Scanner(System.in);
		String[] strings = sc.nextLine().split("/");
		int a = Integer.parseInt(strings[0]);
		int b = Integer.parseInt(strings[1]);
		System.out.println(a + "/" + b + "的结果是" + divide(a, b));
	}

	public static int divide(int a, int b) {
		if (b == 0) {
			throw new ArithmeticException("除数不能为0");
		}
		return a / b;
	}
}
